from urllib.request import *
from fake_useragent import *

# 关于ajax请求的获取

headers = {
    "User-agent": UserAgent().chrome
}

base_url = "https://movie.douban.com/j/chart/top_list?type=11&interval_id=100%3A90&action=&"

count = 1
limit = 100

while True:
    args = f"start={count*limit}&limit={limit}"
    request = Request(f"{base_url}{args}", headers=headers)

    response = urlopen(request)

    info = response.read().decode()

    if info == "[]" or info is None:
        break
    print(info)
    count += 1
